require 'thor'
module ProxyPump
  class Generator < Thor::Group

    include Thor::Actions

    desc 'Gernerate a workspace structure'
    argument :name, default: 'proxy_pump', desc: 'The workspace to create.'

    def self.source_root
      File.expand_path '../templates', __FILE__
    end

    def create_workspace
      empty_directory name
    end

    def create_gem_file
      template 'Gemfile', File.join(name, 'Gemfile')
    end

    def create_config_yml_file
      template 'config.yml', File.join(name, 'config.yml')
    end

    def create_user_agents_yml_file
      template 'user_agents.yml', File.join(name, 'user_agents.yml')
    end

    def create_sources_yml_file
      template 'sources.yml', File.join(name, 'sources.yml')
    end

    def create_proc_file
      template 'Procfile', File.join(name, 'Procfile')
    end

    def create_bin
      directory 'bin', File.join(name, 'bin')
    end

  end # Generator
end # ProxyPump
